package b1.controls.tab
{
	import flash.filters.ColorMatrixFilter;
	import flash.display.Sprite;
	import flash.text.*;

	public class TabTitle extends Sprite
	{
		public var index:int;
		
		public function TabTitle(BackgroundImg:Class, title:String, index:int)
		{
			super();
			this.index = index;
			var backgroundImg:Sprite = new BackgroundImg();
			backgroundImg.filters = [new ColorMatrixFilter(
					[1,0,0,0,-20,
				     0,1,0,0,-20,
				     0,0,1,0,-20,
				     0,0,0,1,0 ])];
			addChild(backgroundImg);
			//标题
			var titleText:TextField = new TextField();
			titleText.selectable = false;
        	titleText.autoSize = TextFieldAutoSize.LEFT;
			titleText.defaultTextFormat = new TextFormat("微软雅黑", 20, 0x000000, true);
			titleText.text = title;
			titleText.x = (backgroundImg.width - titleText.width) / 2;
			titleText.y = (backgroundImg.height - titleText.height) / 2 + 7;
			addChild(titleText);
		}
		
	}
}